/* igmp_constants.h - constants for Routerware igmp code */

/* Copyright 1997 - 2001 Wind River Systems, Inc. */

/*
modification history
--------------------
01d,20nov03,niq  Remove copyright_wrs.h file inclusion
01c,04nov03,rlm  Ran batch header path update for header re-org.
01b,03nov03,rlm  Removed wrn/coreip/ prefix from #includes for header re-org.
01a,29mar01,spm  file creation: copied from version 01b of tor2_0.open_stack
                 branch (wpwr VOB, written by rae) for unified code base;
                 fixed header entries
*/

#ifndef __INCigmp_constantsh
#define __INCigmp_constantsh

#define IGMP_PROTOCOL_ID 2

#define IGMP_V2_DEFAULT_IP_TTL 1

/* was IGMP_DEFAULT_ROBUSTNESS_VARIABLE */
#define IGMP_DEFAULT_ROBUSTNESS_VALUE 2

#define IGMP_DEFAULT_GROUP_QUERY_INTERVAL 10

/* was IGMP_DEFAULT_RESPONSE_TIME_DIVISOR */
#define IGMP_HOST_RESPONSE_TIME_DIVIDER 10

#define IGMP_HOST_V1_ROUTER_PRESENT_TIMEOUT 400

#define IGMP_HOST_DEFAULT_V1_MAX_RESPONSE_TIME 10

#define IGMP_DEFAULT_GENERAL_QUERY_INTERVAL 125

#define IGMP_DEFAULT_GENERAL_QUERY_MAX_RESPONSE_INTERVAL 100

#define IGMP_PROTOCOL_PRIORITY_FOR_MFAPI 255

#define IP_ADDRESS_PRINT_BUFFER_SIZE 20

/* as of IGMPv2, the IGMP message size can only be 8 octets */
#define IGMP_MINIMUM_MESSAGE_SIZE 8

#define IGMP_INVALID_STATE 255

#define IGMP_ROUTER_INVALID_EVENT 255

#define ROUTER_ALERT_OPTION_ID 0x94

#define ROUTER_ALERT_OPTION_LENGTH 0x04

#define ALL_SYSTEMS_MULTICAST_GROUP_ADDRESS 0xe0000001

#define ALL_ROUTERS_GROUP_MULTICAST_ADDRESS 0xe0000002

enum IGMP_ROUTER_PORT_STATE
{
	IGMP_ROUTER_PORT_NON_QUERIER_STATE,
	IGMP_ROUTER_PORT_QUERIER_STATE,

	NUMBER_OF_IGMP_ROUTER_PORT_STATES
};

enum IGMP_ROUTER_PORT_EVENT
{
	IGMP_ROUTER_PORT_GENERAL_QUERY_TIMER_EXPIRED_EVENT,
	IGMP_ROUTER_PORT_QUERY_RECEIVED_FROM_ROUTER_WITH_LOWER_IP_ADDRESS_EVENT,
	IGMP_ROUTER_PORT_OTHER_QUERIER_PRESENT_TIMER_EXPIRED_EVENT,

	NUMBER_OF_IGMP_ROUTER_PORT_EVENTS
};

enum IGMP_ROUTER_GROUP_STATE
{
	IGMP_ROUTER_GROUP_NO_MEMBERS_PRESENT_STATE,
	IGMP_ROUTER_GROUP_V1_MEMBERS_PRESENT_STATE,
	IGMP_ROUTER_GROUP_V2_MEMBERS_PRESENT_STATE,
	IGMP_ROUTER_GROUP_CHECKING_MEMBERSHIP_STATE,

	NUMBER_OF_IGMP_ROUTER_GROUP_STATES
};

enum IGMP_ROUTER_GROUP_EVENT
{
	IGMP_ROUTER_GROUP_V2_REPORT_RECEIVED_EVENT,
	IGMP_ROUTER_GROUP_V1_REPORT_RECEIVED_EVENT,
	IGMP_ROUTER_GROUP_LEAVE_MESSAGE_RECEIVED_EVENT,
	IGMP_ROUTER_GROUP_SPECIFIC_TIMER_EXPIRED_EVENT,
	IGMP_ROUTER_GROUP_RETRANSMIT_TIMER_EXPIRED_EVENT,
	IGMP_ROUTER_GROUP_V1_HOST_TIMER_EXPIRED_EVENT,
	IGMP_ROUTER_GROUP_SPECIFIC_QUERY_RECEIVED_EVENT,

	NUMBER_OF_IGMP_ROUTER_GROUP_EVENTS
};

enum IGMP_HOST_GROUP_STATE
{
	IGMP_HOST_GROUP_NON_MEMBER_STATE,
	IGMP_HOST_GROUP_DELAYING_MEMBER_STATE,
	IGMP_HOST_GROUP_IDLE_MEMBER_STATE,

	NUMBER_OF_IGMP_HOST_GROUP_STATES
};

enum IGMP_HOST_GROUP_EVENT
{
	IGMP_HOST_GROUP_JOIN_EVENT,
	IGMP_HOST_GROUP_LEAVE_EVENT,
	IGMP_HOST_GROUP_QUERY_RECEIVED_EVENT,
	IGMP_HOST_GROUP_REPORT_RECEIVED_EVENT,
	IGMP_HOST_GROUP_REPORT_DELAY_TIMER_EXPIRED_EVENT,

	NUMBER_OF_IGMP_HOST_GROUP_EVENTS
};
 
#ifndef IGMP_MEMBERSHIP_QUERY 
enum IGMP_MESSAGE_TYPE
{
	IGMP_MEMBERSHIP_QUERY = 0x11,
	IGMP_V1_MEMBERSHIP_REPORT = 0x12,
	IGMP_V2_MEMBERSHIP_REPORT = 0x16,
	IGMP_LEAVE_GROUP = 0x17,

	NUMBER_OF_IGMP_MESSAGE_TYPES = 0x18
};
#else
enum IGMP_MESSAGE_TYPE
{
        
    NUMBER_OF_IGMP_MESSAGE_TYPES = 0x18
};
#endif /*  IGMP_MEMBERSHIP_QUERY  */

enum IGMP_VERSION
{
	IGMP_VERSION_1 = 1,
	IGMP_VERSION_2 = 2
};

enum IGMP_TRACE_GROUP
{
	IGMP_TRACE,
	IGMP_ALARM_TRACE
};

#if defined (__IGMP_DEBUG__)
#define IGMP_PROTOCOL_ALARM_TRACE igmp_trace
#define IGMP_PROTOCOL_TRACE igmp_trace
#define IGMP_PROTOCOL_TRACE_DISPLAY_MESSAGE igmp_display_message
#else
#define DISPLAY_MESSAGE_NULL(a, b, c, d, e) 
#define IGMP_PROTOCOL_ALARM_TRACE igmp_trace_null
#define IGMP_PROTOCOL_TRACE igmp_trace_null
#define IGMP_PROTOCOL_TRACE_DISPLAY_MESSAGE  DISPLAY_MESSAGE_NULL
#endif /* __IGMP_DEBUG__ */

#endif /*__INCigmp_constantsh */
